﻿using System;
using System.Data;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;
using PPAP.DAO;
using System.Collections;
using System.Web;

namespace PPAP.WebControls
{
    public class PartNo : System.Web.UI.WebControls.TextBox
    {
        protected string SelectFunction="SelectCompany";

        protected string Param = "";


        private int _mode = -1;
        protected int Mode
        {
            set { _mode = value; }
        }
        private int _IsMy = -1;
        protected int IsMy
        {
            set { _IsMy = value; }
        }

        protected override void Render(HtmlTextWriter writer)
        {


            

            //			base.Render (writer);
            writer.Write(string.Format(" <input name='{0}' type='text' value='{1}' id='{0}' />",base.ID,base.Text));

            string cc = "";
            string s = "";

            if (!base.Enabled)
                s = "disabled='disabled' ";

            //if (_mode > 0)
            //{
            //    if (_IsMy > 0)
            //        cc = "," + _IsMy;
                //writer.WriteLine("<input type=button  name=" + this.ClientID + "_button class=formButton " + s + " onclick=\"" + SelectFunction +
                //    "2('" + this.ClientID + "','" + Param + "'," + _mode + cc + ")\"  value='选择...'>");
                writer.WriteLine("<img alt='' id='' src='../images/newimg/search.png' " + s + " onclick=\"" + SelectFunction +
                    "2('" + this.ClientID + "','" + Param + "'," + _mode + cc + ")\" />");

            //}
            //else
            //{
            //    if (_IsMy > 0)
            //        cc = "," + _IsMy;
            //    string id = this.ClientID;
            //    if (id == "search_ddlCom")
            //        id = "ddlCom";
            //    writer.WriteLine("<input type=button name=" + this.ClientID + "_button class=formButton " + s + " onclick=\"" + SelectFunction +
            //        "('" + id + "','" + Param + "'" + cc + ")\"  value='选择...'>");
            //}
            //			writer.WriteLine( "<input type=button class=formButton "+s+" onclick=\"document.all."+ 
            //				this.ClientID +".value='';document.all." + this.ClientID +"_Id.value='';\"  value='清除'>" );






        }
    }
}
